<div class="content-box">
	<div class="content-box-header">
		<h3 style="cursor: s-resize; ">Content box</h3>
		<ul class="content-box-tabs">
			<li><a href="#" class="default-tab current">Table</a></li>
		</ul>
		<div class="clear"></div>
	</div>
	<div class="content-box-content">
		<div class="tab-content default-tab" style="display: block; ">
			<div class="notification attention png_bg" style="background-image: none;">
				<div>
					<form action="">
						搜索条件：&nbsp;&nbsp;&nbsp;
						小说ID：<input type="text" name="book_id" value="<?php echo isset($_GET['book_id'])? $_GET['book_id'] :'' ; ?>">&nbsp;&nbsp;&nbsp;&nbsp;
						小说标题：<?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
										'name' => 'book_title',
										'value'=> isset($_GET['book_title'])?$_GET['book_title']:'',
										'sourceUrl' => array('getTitle')
								)); ?>&nbsp;&nbsp;&nbsp;&nbsp;
						小说作者：<input type="text" name="book_author" value="<?php echo isset($_GET['book_author'])? $_GET['book_author'] :'' ; ?>">&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="hidden" name="search" value="1">
						<input type="submit" value="搜索"> 
					</form>
				</div>
			</div>
			<table>
				<thead>
					<tr>
						<th>ID</th>
						<th>标题</th>
						<th>作者</th>
						<th>状态</th>
						<th>票数</th>
						<th>类别</th>
						<th>操作</th>
					</tr>
				</thead>
				<tfoot>
				  <tr>
					<td colspan="7" style="text-align:right">
						<?php $this->widget('CLinkPager', array(
									'pages' 		=> $pages,
									'header'		=> '',
									'firstPageLabel'=> '首页',
									'prevPageLabel'	=> '上一页',
									'nextPageLabel'	=> '下一页',
									'lastPageLabel'	=> '尾页',
							)); ?>
					</td>					
				  </tr>
            </tfoot>
				<tbody>
					<?php foreach ($bookModel as $model): ?>
						<tr>
							<td><?php echo $model->book_id; ?></td>
							<td><?php echo CHtml::link($model->book_title,array('edit', 'book_id'=>$model->book_id),array('title'=>'点击查看详细内容')); ?></td>
							<td><?php echo $model->book_author; ?></td>
							<td><?php if($model->book_status == 1): ?>已完结<?php else: ?>未完结<?php endif; ?></td>
							<td><?php echo $model->book_vote; ?></td>
							<td><?php echo $model->book_category_name; ?></td>
							<td>
								<?php echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl.'/images/admin/icons/hammer_screwdriver.png','点击查看详细内容'),array('edit', 'book_id'=>$model->book_id),array('title'=>'点击查看详细内容')); ?>
								<?php echo CHtml::ajaxLink(CHtml::image(Yii::app()->request->baseUrl.'/images/admin/icons/cross.png','删除'), array('delete'),array(
											'type'		=> 'POST',
											'data'		=> 'book_id='.$model->book_id,
											'success'	=> 'function(data){if(data){$("#delete_'.$model->book_id.'").parent().parent().remove()}}',
										),array('title'=>'删除','id'=>'delete_'.$model->book_id))?>
							</td>
						</tr>
					<?php endforeach; ?>
				</tbody>
			</table>

		</div>
	</div>
</div>